package cn.school.vo;

import lombok.Data;

import java.io.Serializable;

@Data
public class ResultVo implements Serializable {
    private Integer code;
    private String message;
    private Object object;
    public static ResultVo ok(Object object){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(200);
        resultVo.setMessage("ok");
        resultVo.setObject(object);
        return resultVo;
    }
    public static ResultVo error(Object object){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(400);
        resultVo.setMessage("error");
        resultVo.setObject(object);
        return resultVo;
    }
}
